/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stringhelper;

import java.util.ArrayList;

/**
 *
 * @author Welcome
 */
public class StatementID {
    private ArrayList<KindOfStatement> kinds = new ArrayList<KindOfStatement>();
    

    public StatementID() {
        kinds.add(KindOfStatement.SELECT);
        kinds.add(KindOfStatement.CREATE);
        kinds.add(KindOfStatement.INSERT);
        kinds.add(KindOfStatement.DELETE);
    }
    
    public KindOfStatement getID(String statement)
    {
        for(int i=0;i<kinds.size();i++)
        {
            int temp = statement.indexOf(kinds.get(i).toString().toLowerCase());
            if( temp!=-1)
            {
                return kinds.get(i);
            }
        }
        return null;
    }
    
}
